package cn.mulanbay.log.web.config;

import cn.mulanbay.api.system.factory.RemoteMessageFallbackFactory;
import cn.mulanbay.api.system.factory.RemoteRoleFallbackFactory;
import cn.mulanbay.api.system.factory.RemoteUserFallbackFactory;
import cn.mulanbay.business.handler.FeignCheckHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class FeignConfig {

    /**
     * Feign验证处理
     * @return
     */
    @Bean
    public FeignCheckHandler feignCheckHandler() {
        return new FeignCheckHandler();
    }

    /**
     * FeignClient熔断器
     * @return
     */
    @Bean
    public RemoteRoleFallbackFactory remoteRoleFallbackFactory(){
        return new RemoteRoleFallbackFactory();
    }

    @Bean
    public RemoteMessageFallbackFactory remoteMessageFallbackFactory(){
        return new RemoteMessageFallbackFactory();
    }

    @Bean
    public RemoteUserFallbackFactory remoteUserFallbackFactory(){
        return new RemoteUserFallbackFactory();
    }
}
